package services
{
	
	import mx.controls.Alert;
	import mx.messaging.ChannelSet;
	import mx.messaging.channels.AMFChannel;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.remoting.mxml.RemoteObject;
	
	public class AutosService extends RemoteObject
	{
		public function AutosService()
		{	
			super();
			var channel:ChannelSet=new ChannelSet();
			var amfChannel:AMFChannel=new AMFChannel("my-amf","http://localhost:8080/Servicios/messagebroker/amf");
			channel.addChannel(amfChannel);
			this.channelSet=channel; 
			this.destination="AutosService";
			this.source="services.AutosService";  
			this.addEventListener(FaultEvent.FAULT,onFault);
			
		}
			           
			public function onFault(event:FaultEvent):void
			{                  
				Alert.show( "Error comunicando con "+this.destination+
					" \nDetalle:"+event.fault.message);         
			}
			
			public function editarAutos():void
			{
				this.getOperation("editarAutos").send();
			}

		
	}
}